package com.cn.jiyun.contoller;

import com.alibaba.dashscope.exception.InputRequiredException;
import com.cn.jiyun.AiClient;
import com.jiyun.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("ai")
public class AiController {
    @Autowired
    private AiClient aiClient;
    @RequestMapping("/backinfo")
    public Result<String> backinfo(@RequestParam("question") String question) throws InputRequiredException {
        return Result.ok(aiClient.backinfo(question).getData());
    }
}
